package com.grass.appointment.model;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.androidx.p013lv.base.bean.OfficialListBean;
import com.androidx.p013lv.base.http.BaseRes;
import com.androidx.p013lv.base.http.HttpUtils;
import com.androidx.p013lv.base.http.UrlManager;
import com.androidx.p013lv.base.http.callback.HttpCallback;

public class OfficialModel extends ViewModel {
    private MutableLiveData<BaseRes<OfficialListBean>> data;

    public MutableLiveData<BaseRes<OfficialListBean>> data() {
        if (this.data == null) {
            this.data = new MutableLiveData<>();
        }
        return this.data;
    }

    public void getInfo(String str, int i) {
        HttpUtils.getInsatance().get(UrlManager.getInsatance().officialList(str, i, 30), new HttpCallback<BaseRes<OfficialListBean>>("officialList") {
            /* class com.grass.appointment.model.OfficialModel.C28431 */

            public void onLvSuccess(BaseRes<OfficialListBean> baseRes) {
                OfficialModel.this.data.setValue(baseRes);
            }
        });
    }

    public void cancelHttp() {
        HttpUtils.getInsatance().cancelTag("officialList");
    }
}
